<?php
$sell = "SELECT * FROM cat_t";
$sell_q = mysql_query($sell);
$row_ll = mysql_fetch_assoc($sell_q);

$selll_c = mysql_query("SELECT * FROM com_t WHERE title_t='".$row_ll['t_title']."'");

if(mysql_num_rows($selll_c) == 0){
   echo '<p class="error">Няма мнения към тази тема!</p>';
} else {
while($row_cc = mysql_fetch_assoc($selll_c)) {
?>
<div id='comments'>
	<table width='100%' style='background: #888787;'> 
		<tr>
			<td style='background: none; color: #fff;'>
				<b>От:</b> <?php echo $row_cc['who_added']; ?>
			</td>
			<td style='background: none; color: #fff;'>
				<b>На:</b> <?php echo date('Y-m-d / G:i:s', $row_cc['date'])?>
			</td>
			<?php 
				if($row_cc['who_added'] == $_SESSION['username']) {
					?>
					<div id='linkx'><td style='float: right;text-align: right;padding-right: 5px;'><a href='<?php echo 'includes/del_com.php?id='.$row_cc['id'].'';?>' style="color: black;">X</a></td></div>
					<?php	
				}
			?>
		</tr>
	</table>
<div id='real_com'>
<br />
<?php echo ucfirst($row_cc['comment']);?>
</div>
</div>
<br /><hr width='92%'/><br />
<?php
}
}
?>